package com.itboye.jmsfhz.app.logincontroller;


import com.itboye.core.utils.DebugLog;
import com.itboye.jmsfhz.app.ui.me.personsettings.SettingActivity;
import com.itboye.jmsfhz.main.WoMengFragment;

import android.app.Activity;
import android.app.Fragment;
/**
 * 登录相关控制类--状态模式</br></br>
 * 
 * 登录成功后调用setLoginState(new LoginedState());</br></br>
 * 退出登录后调用setLoginState(new UnLoginState());</br></br>
 * 进入主Activity前一定要设置一次，要么登录要么未登录</br></br>
 * @author Mr.w
 *
 */
public class LoginController {

	private static ILoginState loginState=new UnLoginState();

	public static void setLoginState(ILoginState loginState) {
			
		LoginController.loginState = loginState;
		if (loginState instanceof UnLoginState) {
			DebugLog.v("bytag", "未登录。。。");
		}else if (loginState instanceof LoginedState) {
			DebugLog.v("bytag", "已登录。。。");
		}
	}

	
	public static void testClick(Activity act,Object data) {
		loginState.test(act,data);
	}
	
	public static void queryMyMessae(Activity  settingActivity,Object data){
		loginState.goToMyMessage(settingActivity,data);
		}
	
	public static void getProject() {
		loginState.getTouBiao();
	}
	
	public static void  getShoudao(Activity activity,Object obj){
		loginState.getSHouDao(activity, obj);
	}
	public static void  getFragemntEm(Activity activity){
		loginState.getFragemntEm(activity);
	}
	
//	/**
//	 * 
//	 * @param 个人设置
//	 * @param data
//	 */
//	public static void onPersonalsettingClick(Activity act,Object data){
//		loginState.goToMyMessage(act,data);
//	}
//	
}
